<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
	String path=request.getContextPath();
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
  <head>
  	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>FTP帐号创建系统</title>
	<link rel="stylesheet" href="<%=path %>/css/public.css" type="text/css"  />
	<link rel="stylesheet" href="<%=path %>/css/module.css" type="text/css"  />
	<link rel="stylesheet" href="<%=path %>/css/skin_blue.css" type="text/css"  />
	<script type="text/javascript" src="<%=path %>/js/json.js"></script>
	<script type="text/javascript" src="<%=path %>/js/jquery/jquery-1.8.0.min.js"></script>
	<!--[if IE 6]> 
	<script src="../js/ie6comm.js"></script> 
	<script> 
	DD_belatedPNG.fix('img'); 
	</script> 
	<![endif]-->
	<script type="text/javascript">
		
		function initUsername(obj){
			if(obj.value=="1"){
				document.getElementById('user').value="dpd";
				document.getElementById('user').disabled="true";
			}else{
				document.getElementById('user').value="admin";
				document.getElementById('user').disabled="true";
			}
		}
		function login(){
			var username=document.getElementById('user').value;
			var pass=document.getElementById('passw').value;
			if(!pass){
				document.getElementById('msg_div1').className='login_error';
				return;
			}
			var param={
				username:username,
				password:pass	
			};
			$.ajax({
				type:'post',
				url:'<%=path %>/login!ajaxLogin.action',
				data:'requestData='+Ext.util.JSON.encode(param),
				success:function(responseData){
					var data=responseData.result;
					if(data=="1"){
						document.getElementById('frmLogin').submit();
					}else{
						document.getElementById('msg_div2').className='login_error';
					}
				}
			});
		}
	</script>
  </head>
	<body class="login_bg" >
	<center>
	<form action="<%=path %>/login!login.action" id="frmLogin" name="frmLogin" enctype="multipart/form-data" method="post">
	<div class="login_main">
		<div class="login_logo">
			 <!--<h2><img src="<%=path %>/images/logo_school.png" /></h2>-->
	                 <h2><img src="<%=path %>/images/logo_system.png" /></h2>
		</div>
		<div class="login_left">
			<img class="login_pic" src="<%=path %>/images/login_pic.jpg" />
	  </div>
		<div class="login_right">
			
			<div class="login">
				<div class="user">
					<label for="">
						用户名：
					</label>
					<input type="text" class="text_nor" id="user" name="user" style="width:100px" value="admin" disabled="true"/>
				</div>
				<div class="passw">
					<label for="">
						密　码：
					</label>
					<input class="text_nor" type="password" id="passw" name="passw" style="width:100px" onFocus="document.getElementById('msg_div1').className='hide';document.getElementById('msg_div2').className='hide';"/>
	            <div id="msg_div1" class="hide">
	            	<div class="prompcon">
	              	<p>请输入密码!</p>
	              </div>
	            </div>
	            <div id="msg_div2" class="hide">
	            	<div class="prompcon">
	              	<p>密码错误!</p>
	              </div>
	            </div>
				</div>
				
				<div class="">
					<label>
						<input type="radio" name="rg_usertype" value="0"
							id="RadioGroup1_0" onclick="initUsername(this)" checked="true"/>
						管理员
					</label>
					<label>
						<input type="radio" name="rg_usertype" value="1"
							id="RadioGroup1_1" onclick="initUsername(this)"/>
						创建者
					</label>
				</div>
				<div class="btn">
					<input type="button" class="btn_dl" onclick="login();"/>
					<input type="button" class="btn_cz" onclick="document.getElementById('passw').value='';" />
					</div>
					<div class="login_notice">
			          <h3>热心提示：</h3>
			          <p>为了您的帐号安全，请及时修改您的初始密码。</p>
			        </div>
				</div>
				
			</div>
			<div class="login_copyright">
				<span>&copy;2012-2013<a href="http://www.ceode.cas.cn/" target="_blank">中国科学院对地观测与数字地球科学中心</a> <span>&nbsp;&nbsp;地址：海淀区邓庄南路9号&nbsp;&nbsp;邮编：100094</span></span>
			</div>
		</div>
		</form>
		</center>
	</body>
</html>
